package com.leyou.repository;

import com.leyou.entity.CartItem;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * @author jshstart
 * @creat 2020-12-25 12:34
 */

/**
 * 继承MongoRepository接口，获得crud的方法
 */
public interface TradeRepository extends MongoRepository<CartItem,String> {
    //根据id查询并排序
    List<CartItem> findByUserId(Long userId, Sort sort);
}
